import Layout from '@/layout'

// 动态路由
export const dynamicRoutes = [
    {
        path: '/',
        name: '/',
        component: Layout,
        redirect: '/home',
        meta: {
            isKeepAlive: true,
        },
        children: [
            {
                path: '/home',
                name: 'home',
                component: () => import('@/views/home'),
                meta: {
                    title: '首页',
                    isLink: '',
                    isHide: false,
                    isKeepAlive: true,
                    isAffix: true,
                    isIframe: false,
                    permissions: ['home'],
                    icon: 'dashboard'
                },
            },
            /** 组件 */
            {
                path: '/components',
                name: 'components',
                component: () => import('@/layout/Main/parentView.vue'),
                meta: {
                    title: '组件',
                    isLink: '',
                    isHide: false,
                    isKeepAlive: true,
                    isAffix: false,
                    isIframe: false,
                    permissions: ['components'],
                    icon: 'dashboard'
                },
                children: [
                    {
                        path: '/components/table',
                        name: 'componentsTable',
                        meta: {
                            title: '表单',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/components/table"),
                    },
                    {
                        path: '/components/previewImage',
                        name: 'componentsPreviewImage',
                        meta: {
                            title: '预览图片',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/components/previewImage"),
                    }
                ]
            },

            /** 系统管理 */
            {
                path: '/system',
                name: 'system',
                component: () => import('@/layout/Main/parentView.vue'),
                meta: {
                    title: '系统管理',
                    isLink: '',
                    isHide: false,
                    isKeepAlive: true,
                    isAffix: false,
                    isIframe: false,
                    permissions: ['components'],
                    icon: 'dashboard'
                },
                children: [
                    {
                        path: '/system/user',
                        name: 'user',
                        meta: {
                            title: '用户管理',
                            isLink: '',
                            isHide: false,
                            isKeepAlive: true,
                            isAffix: false,
                            isIframe: false,
                            permissions: ['previewImage'],
                            icon: ''
                        },
                        component: () => import("@/views/system/user"),
                    }
                ]
            },
        ]
    },

]

// 静态路由
export const staticRoutes = [
    {
        path: '/login',
        name: 'login',
        component: () => import("@/views/login"),
        meta: {
            title: '登录',
        }
    }
]

// 404、401界面
export const notFoundAndNoPower = [
    {
        path: '/:path(.*)*',
        name: 'notFound',
        component: () => import('@/views/error/404.vue'),
        meta: {
            title: '找不到此页面',
            isHide: true,
        },
    },
    {
        path: '/401',
        name: 'noPower',
        component: () => import('@/views/error/401.vue'),
        meta: {
            title: '没有权限',
            isHide: true,
        },
    },
]
